<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //打印等腰三角形
var m=+prompt("请输入需要的行数");
for(var i=1;i<=m;i++){
    for(var j=1;j<=m-i;j++){
        document.write(`<span style="display: inline-block;width: 20px;text-align: center;"></span>`);
    }
    for(var k=1;k<=i*2-1;k++){
        document.write(`<span style="display: inline-block;width: 20px;text-align: center;">*</span>`);
    }
    document.write(`<br/>`)
}

    </script>

</body>
</html>